<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="test"></div>
  <div id="test1"></div>
  <div id="test2"></div>

  <script type="text/javascript" src="../js/react.development.js"></script>
  <script type="text/javascript" src="../js/react-dom.development.js"></script>
  <script type="text/javascript" src="../js/babel.min.js"></script>
  <script type="text/javascript" src="../js/prop-types.js"></script>
  <script type="text/babel">
    function Person(props){
        const {name,age,sex}=props
        return (
            <ul>
                <li>姓名：{name}</li>
                <li>年龄：{age}</li>
                <li>性别：{sex}</li>
            </ul>
        )
    }
    Person.propTypes={
        name:PropTypes.string.isRequired,
        age:PropTypes.number,
        sex:PropTypes.string,
        }
    Person.defaultProps={
        sex:'不知男女',
        age:18
    }
    ReactDOM.render(<Person name='wtt' age={18} sex='男'/>,document.getElementById('test'))
   
  </script>
</body>

</html>